package parser

import (
	"fmt"
	"testing"
)

func TestQueryParse(t *testing.T) {
	cases := []struct {
		query    string
		expected string
	}{
		{"SELECT * FROM t1", "SELECT * FROM t1"},
		{"SELECT * FROM t1 WHERE id = 1", "SELECT * FROM t1 WHERE id = 1"},
		{"SELECT * FROM t1 WHERE id = 1 AND name = 'John'", "SELECT * FROM t1 WHERE id = 1 AND name = 'John'"},
	}

	for i, c := range cases {
		t.Run(fmt.Sprintf("TestQueryParse Case %d", i), func(t *testing.T) {
			result, err := QueryParse(c.query)
			if err != nil {
				t.Fatalf("Expected no error, got %s", err)
			}
			// if result != c.expected {
			// 	t.Errorf("Expected %s, got %s", c.expected, result)
			// }
			fmt.Printf("%+v", result)
		})
	}
}
